home *** CD-ROM | disk | FTP | other *** search
/ Adobe Graphics & Publishing SDK 1996 December / Adobe Graphics & Publishing SDK 1996 December.iso / mac / PageMaker 6.5 SDK Mac / SourceCode / PageMakerClassLibrary / Queries / PGetPrivateList.cpp < prev    next >
C/C++ Source or Header  |  1996-08-15  |  2KB  |  68 lines

  1. /*
  2.  *--- PGetPrivateList.cpp -------------------------------------------------
  3.  * Copyright (c) 1995-96 Adobe Systems Incorporated.  All rights reserved.
  4.  * Created on Thu, Oct 12, 1995 @ 10:00 PM by Paul Ferguson.
  5.  *
  6.  * Description:  For notes about this class, refer to the
  7.  * PCL documentation file PGetPrivateList.html
  8.  *-------------------------------------------------------------------------
  9.  */
  10.  
  11. #include <string.h>
  12.  
  13. #include "PMCQErrs.h"
  14. #include "PGetPrivateList.h"
  15. #include "PQuery.h"
  16. #include "PRequestBuf.h"
  17. #include "PReplyBuf.h"
  18.  
  19.  
  20. PGetPrivateList::PGetPrivateList
  21.   (    const char * sDeveloperID,
  22.     const char * sPluginID,
  23.     short cTargetClass,
  24.     unsigned long nTypeFlag,
  25.     unsigned long nTargetID )
  26.  
  27. : PListQuery()
  28.  
  29. {
  30.     if (strlen(sDeveloperID) != 4 || strlen(sPluginID) != 4)
  31.         throw CQ_INVALID_CQ_ARG;
  32.         
  33.     PRequestBuf request(100);        // plenty big to hold everything.
  34.     request << sDeveloperID
  35.             << sPluginID
  36.             << cTargetClass
  37.             << nTypeFlag
  38.             << nTargetID;
  39.  
  40.     // NOTE! NOTE! NOTE! NOTE! NOTE! NOTE! NOTE! NOTE! NOTE!
  41.     //   If the object has no private data, an exception
  42.     //   (CQ_NOPDATA) will be thrown.  If you don't want
  43.     //   your plug-in to fail, you must handle the exception.
  44.     PQuery query(pm_getprivatelist, request, itsHandle);
  45.  
  46.     InitHandle();
  47.     InitListMom();
  48.     Scan();
  49. }
  50.  
  51.  
  52. void PGetPrivateList::Scan()
  53. {
  54.     PReplyBuf reply(listMom.Current());
  55.     
  56.     reply    >> &devID
  57.             >> &pluginID
  58.             >> targetClass
  59.             >> typeFlag
  60.             >> targetID
  61.             >> cPlatform
  62.             >> nSize;
  63.     
  64.     listMom.Update(reply);
  65. }
  66.  
  67. // end of PGetPrivateList.cpp
  68.